import http from "../request";
const apibase = "/api/JobRouteOperationRelation";
import qs from "qs";
//获取工作集
var getJobGroupToList = function (data) {
  return new Promise((resolve, reject) => {
    http
      .post(apibase + `/GetJobGroupToList?${qs.stringify(data)}`)
      .then((res) => {
        resolve(res);
      })
      .catch((error) => {
        reject(error);
      });
  });
};

//获取工艺关联工作集
var getJobrouteoperationrelationsToList = function (data) {
  return new Promise((resolve, reject) => {
    http
      .post(
        apibase + `/GetJobrouteoperationrelationsToList?${qs.stringify(data)}`
      )
      .then((res) => {
        resolve(res);
      })
      .catch((error) => {
        reject(error);
      });
  });
};

//新增关联工作集
var insJobrouteoperationrelations = function (data) {
  return new Promise((resolve, reject) => {
    http
      .post(apibase + `/InsJobrouteoperationrelations`, data)
      .then((res) => {
        resolve(res);
      })
      .catch((error) => {
        reject(error);
      });
  });
};

//取消关联工作集
var delJobrouteoperationrelations = function (data) {
  return new Promise((resolve, reject) => {
    http
      .post(apibase + `/DelJobrouteoperationrelations`, data)
      .then((res) => {
        resolve(res);
      })
      .catch((error) => {
        reject(error);
      });
  });
};

export {
  getJobGroupToList,
  getJobrouteoperationrelationsToList,
  insJobrouteoperationrelations,
  delJobrouteoperationrelations,
};
